#!/bin/bash

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 50
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 50
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 100
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 50
update-alternatives --set g++ /usr/bin/g++-4.4
update-alternatives --set gcc /usr/bin/gcc-4.4
update-alternatives --set cpp-bin /usr/bin/cpp-4.4

VER_FOUND=`gcc --version | grep -i "gcc"`

echo "default is now : $VER_FOUND"
